package org.jackysoft.struts2.business;
import java.util.Collection;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Namespace;
import org.jackysoft.entity.YearPlan;
import org.jackysoft.service.YearPlanService;
import org.jackysoft.struts2.UtilsCRUDAction;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;


@Controller
@Namespace("/yearplanning")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class YearPlanAction 
extends UtilsCRUDAction<YearPlan> {
	/**
	 * 
	 */
	private static final long serialVersionUID = -5355126986441170969L;
	private YearPlanService service;	
	private YearPlan bean;
	private Collection<YearPlan> beans;
	private Integer year = 2011;	
	
	
	
	public String importdata() throws Exception{
		service.importData(year, upLoad);
		return "importdata";
	}	
	
	
	public void setBean(YearPlan bean){
	     this.bean = bean;
	}
	public YearPlan getBean(){
	     return this.bean;
	}
	public void setBeans(Collection<YearPlan> beans){
	
	     this.beans = beans;
	}
	public Collection<YearPlan> getBeans(){
	     return this.beans;
	}
	
	@Resource
	public void setService(YearPlanService service) {
		this.service = service;
		this.setDataProvider(service);
	}	
	
	public YearPlanService getService(){
	   return this.service;
	}
	
	public Integer getYear() {
		return year;
	}

	public void setYear(Integer year) {
		this.year = year;
	}
	
		
}